package com.craiglarman.monopoly.domain;

import java.util.ArrayList;
import java.util.List;

public class Board {

	public static final int SIZE = 40;
	
	private List<Square> squares = new ArrayList<Square>(SIZE);
	
	public Board() {
		for(int i=0; i<SIZE; i++) {
			squares.add(new Square());
		}
	}
	
	public int getSquareCount() {
		return squares.size();
	}

	public Square getSquare(Square square, int increment) {
		int oldSquarePosition = squares.indexOf(square);
		int newSquarePosition = (oldSquarePosition+increment) % SIZE;
		return squares.get(newSquarePosition);
	}	
	
	public Square getSquare(int index) {
		return squares.get(index);
	}
	
	public Square getFirstSquare() {
		return getSquare(0);
	}

}
